package com.health.viewscontrols.medical;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;

import com.blankj.utilcode.util.ToastUtils;
import com.bumptech.glide.Glide;
import com.github.chrisbanes.photoview.PhotoView;
import com.health.R;
import com.health.viewscontrols.tjbg.base.NovaPtActivity;

/**
 * 大图查看
 */
public class PhotoViewActivity extends NovaPtActivity {

    private PhotoView photoView;
    private String imgUrl;

    @Override
    public void initData(@Nullable Bundle bundle) {

        imgUrl = getIntent().getStringExtra("imgUrl");
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_photo_view;
    }

    @Override
    public void initView(Bundle savedInstanceState, View contentView) {

        photoView = findViewById(R.id.photo_view);
    }

    @Override
    public void doBusiness() {
        if (!TextUtils.isEmpty(imgUrl)) {
            Glide.with(this).load(imgUrl).into(photoView);
        } else {
            ToastUtils.showShort("图片不能为空");
        }

    }
}
